﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTO;
using ModuleDALCore;

namespace DAL
{
	public class TIENCOCDAO:DALBase
	{
		public TIENCOCDAO()
        {
            this.OpenConnect();
        }
        private DataTable dt;
        private string _SpName;

        public string SpName
        {
            get { return "SPTIENCOC"; }
            set { _SpName = value; }
        }
		public TIENCOC GETATIENCOC(TIENCOC tc)
		{
			TIENCOC benhnhanc = new TIENCOC();
			dt = new DataTable();
			try
			{

				dt = DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(tc, null), ConvertClassToArray.GetValues(tc, 2));
				benhnhanc = (TIENCOC)ConvertDatatableToList.ConvertToObject<TIENCOC>(dt);
			}
			catch { return null; }
			return benhnhanc;
		}
		public bool INSERT(TIENCOC cv)
		{

			try
			{
				return (DBManager.Intance.ExecuteNonQuery(SpName, ConvertClassToArray.GetParamName(cv, null), ConvertClassToArray.GetValues(cv, 1)) == 1);

			}
			catch { return false; }
		}
	}
}
